package com.example.prototype_2;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;

public class VoiceFragment extends Fragment {

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View voiceLayout = inflater.inflate(R.layout.voice_layout,
                container, false);

        final Button voice_button_start = (Button) voiceLayout.findViewById(R.id.button_recordStart);

//////////////////////////////////////////////////////////这里没有添加list

        /**
         * 设置录音按钮的监听函数
         */
        voice_button_start.setOnClickListener(new View.OnClickListener(){
            public void onClick(View v) {
                onButtonClickedListener_voice.onButtonClicked_voice();
            }
            });

        return voiceLayout;
    }

    public interface OnButtonClickedListener_Voice {
        public void onButtonClicked_voice();
    }

    private OnButtonClickedListener_Voice onButtonClickedListener_voice;

    @Override
    public void onAttach(Activity activity){
        super.onAttach(activity);

        try {
            onButtonClickedListener_voice = (OnButtonClickedListener_Voice) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString() + "must implement OnButtonClickedListener");
        }
    }

}